home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.7 KB | 68 lines | [TEXT/ttxt] |
- --<<<-
- -- Filename:
- -- adobject.sx
-
- -- Other Files Required:
- -- None
-
- -- Purpose:
- -- adobject.sx defines the AdDataObject class, which represents a classified ad.
-
- -- Specialized Classes:
- -- AdDataObject
-
- -- Instructions to User:
- -- The AdDataObject is a class which is simply a collection of data properties
- -- for cars for sale.
-
- -- Author:
- -- Dionn Stewart
-
- in module Autofinder
-
- class AdDataObject ()
- instance variables
- classification
- name -- string, the name of the object (currently same as model)
- model -- string, the name of the car
- year -- integer, the year of the car
- price -- integer, the asking price of the car
- location -- owner's location on map
- adPic -- a bitmap, the picture of the car for the ad
- adText -- a string, the text of the ad for the car
- mapPresenter
- adNotes -- text object to hold notes
- end
-
- method init self {class AdDataObject} #rest args #key data: (undefined) ->
- (
- apply nextMethod self args
- -- If data is passed in, fill in instance variables.
- if (data <> undefined) then
- (
- self.adPic := data[9]
- self.classification := data[2]
- self.name := data[3]
- self.model := data[3]
- self.year := data[4]
- self.price := data[5]
- self.adText := data[6]
- self.location := new Point x:data[7] y:data[8]
- self.adNotes := new text string:""
- makePurgeable self.adPic
- )
- -- No data, set the defaults.
- else
- (
- -- Create a bitmap with black invisible color.
- local ws := new bitmapsurface bbox:(new rect x2:200 y2:163)
- erase ws blackbrush
- local wbm := coerce ws Bitmap
- wbm.invisiblecolor := blackcolor
- self.adPic := wbm
- self.adText := ""
- )
- return self
- )
- -->>>
- "Compiled adobject.sx"